PICTools Programmer's Reference
Register Image

Adjusts the left and/or top margins of an image to a specified width. The margin may be defined as the distance from the edge of the page to the text on the page, or the distance from the edge of the page to the first straight line parallel to the edge. The margin may be increased or decreased in width. Any pixels added to the margin are white, ignoring the value of u.SF.PadColor.

This subcode differs from others in that the output image dimensions are unknown at the end of the REQ_INIT phase. Before the REQ_INIT phase, the output queue need not be allocated, but the Q_REVERSE flag should be set appropriately. The Put queue need not be allocated until the first RES_PUT_NEED_SPACE call which occurs in the REQ_EXEC phase. At this time, the output image dimensions are known and stored in RegionOut. The Put queue can be allocated at this time. After the REQ_EXEC phase, the value of OutputStride is set to reflect the dimensions of the output image.

The uncompressed image to be processed must reside in the Get Queue prior to REQ_EXEC. Typically, the image will be fully contained in the Get Queue, but that is not a requirement. The output image will be placed into the Put Queue during REQ_EXEC.

It is recommended that the image be deskewed before attempting registration.

Horizontal registration (adjusting the left margin) and vertical registration (adjusting the right margin) are controlled independently. In most respects these operations are totally isomorphic.

The number of columns or rows removed is stored after the REQ_EXEC phase in the entries u.SC24.HorizontalRegister.FeedbackLinesRemoved and u.SC24.HorizontalRegister.FeedbackLinesRemoved, respectively. Either of these values may be positive (indicating a reduction in the image dimensions) or negative (indicating an increase in the image dimensions). In the event that the AddOnly (see below) option is used for either vertical or horizontal registration, the values returned in u.SC24.HorizontalRegister.FeedbackLinesRemoved and u.SC24.HorizontalRegister.FeedbackLinesRemoved indicate the number of columns or rows that would have been removed if the AddOnly option were not used. The number of columns or rows actually removed can be determined by comparing the input and output image dimensions.

In Register.ToLine mode, the parameters MinBackground, MinForeground, MinActivity, CentralFocus, and IgnoreHoles described above have no effect. The parameters ToLineCheckThinLinesActive, ToLineMaxGap, ToLineMaxLineThickness, and ToLineMinLineLength described below have effect only in Register.ToLine mode.

In addition to placing an output image into the Put Queue, this operation stores some output information into the PIC_PARM structure in the following locations.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback